#import "CableImaginationController.h"
        
#import "CableImaginationModel.h"
#import "CableImaginationCell.h"
#import "Masonry.h"

@interface CableImaginationController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *yearnVelvetTonicTableView;
@property (nonatomic, strong) NSMutableArray *joyousWandererDatas;

@end

@implementation CableImaginationController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self upliftVortexEnchantingConfiglayout];
	[self elusiveSuspicionloadData];
}


- (UITableView *)figHandleTableView {
    if (!_yearnVelvetTonicTableView) {
        _yearnVelvetTonicTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _yearnVelvetTonicTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _yearnVelvetTonicTableView.estimatedRowHeight = 0;
        _yearnVelvetTonicTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _yearnVelvetTonicTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _yearnVelvetTonicTableView.delegate = self;
        _yearnVelvetTonicTableView.dataSource = self;
        _yearnVelvetTonicTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _yearnVelvetTonicTableView.showsVerticalScrollIndicator = NO;
        _yearnVelvetTonicTableView.showsHorizontalScrollIndicator = NO;
        _yearnVelvetTonicTableView.backgroundColor = UIColor.clearColor;
    }
    return _yearnVelvetTonicTableView;
}

//: 获取数据模型
- (void)elusiveSuspicionloadData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)joyousWandererDatas {
	if (!_joyousWandererDatas) {
		_joyousWandererDatas = [NSMutableArray array];
	}
	return _joyousWandererDatas;
}

//: 初始化页面UI
- (void)upliftVortexEnchantingConfiglayout {

	[self.view addSubview:self.yearnVelvetTonicTableView];
	[self.yearnVelvetTonicTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


#pragma mark - UITableView DataSource 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.joyousWandererDatas.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    CableImaginationCell *keepsake = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([CableImaginationCell class])];
    if (keepsake == nil) {
        keepsake = [[CableImaginationCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([CableImaginationCell class])];
    }
    keepsake.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return keepsake;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	CableImaginationModel *crispYarnAmber = self.joyousWandererDatas[indexPath.row];
	return crispYarnAmber.xenophobeKingdomButterflyCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
